package com.yang.aop;

import com.yang.config.SpringConfig;
import com.yang.service.UserServiceImpl;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description:
 * @author: Yang Qiang
 * @create: 2021-10-23 21:28
 */
public class AOPTest {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfig.class);

		// 因为这里返回的就是产生的代理对象, 代理对象需要用实现的接口去接收
		I n = (I) applicationContext.getBean("n");

		M m = (M) applicationContext.getBean("m");
		m.b();
		n.b();
	}
}
